package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2021/11/9 上午11:59
 **/
@Getter
public enum VoiceprintMatch {
    SELF("1", "本人"),
    OTHER("2", "疑似非本人"),
    ;

    private final String match;
    private final String matchText;

    VoiceprintMatch(String match, String matchText) {
        this.match = match;
        this.matchText = matchText;
    }

    public static VoiceprintMatch of(String match) {
        for (VoiceprintMatch statusEnum : values()) {
            if (statusEnum.match.equalsIgnoreCase(match)) {
                return statusEnum;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
